package com.five.sbgroup5job.controller;

//呼卓盈

import com.five.sbgroup5job.entity.Staff;
import com.five.sbgroup5job.service.StaffService;
import com.five.sbgroup5job.vo.StaffVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/staffs")
public class StaffController {

    @Resource
    private StaffService staffService;

    //查询
    @RequestMapping("/staffList")
    public List<Staff> staffList() {
        return staffService.staffList();
    }


    //添加
    @RequestMapping("/staffAdd")
    public String staffList(@RequestBody StaffVo staffVo) {
        return staffService.staffAdd(staffVo);
    }

    //修改
    @RequestMapping("/staffUpdate")
    public String staffList1(@RequestBody StaffVo staffVo) {
        return staffService.staffUpdate(staffVo);
    }

    //删除
    @RequestMapping("/staffDelete")
    public String staffList2(@RequestBody StaffVo staffVo) {
        return staffService.staffDelete(staffVo);
    }
}
